package com.pokermind.dse.tcp.client.interactive;

/**
 * 玩家信息（交互式客户端本地状态）
 * 
 * @author PokerMind Interactive Client
 */
public class Player {
    private String userId;
    private String position;    // SB, BB, UTG, MP, CO, BTN
    private int seatNumber;
    private int stack;
    private String holeCards;   // 底牌（如果已知）
    private PlayerStatus status;
    private int currentBet;     // 当前街道已下注金额
    private String lastAction;  // 最后一次行动
    private int lastActionAmount; // 最后一次行动金额
    
    public Player(String userId, String position, int seatNumber, int stack) {
        this.userId = userId;
        this.position = position;
        this.seatNumber = seatNumber;
        this.stack = stack;
        this.status = PlayerStatus.ACTIVE;
        this.currentBet = 0;
    }
    
    // Getters and Setters
    public String getUserId() { return userId; }
    public void setUserId(String userId) { this.userId = userId; }
    
    public String getPosition() { return position; }
    public void setPosition(String position) { this.position = position; }
    
    public int getSeatNumber() { return seatNumber; }
    public void setSeatNumber(int seatNumber) { this.seatNumber = seatNumber; }
    
    public int getStack() { return stack; }
    public void setStack(int stack) { this.stack = stack; }
    
    public String getHoleCards() { return holeCards; }
    public void setHoleCards(String holeCards) { this.holeCards = holeCards; }
    
    public PlayerStatus getStatus() { return status; }
    public void setStatus(PlayerStatus status) { this.status = status; }
    
    public int getCurrentBet() { return currentBet; }
    public void setCurrentBet(int currentBet) { this.currentBet = currentBet; }
    
    public String getLastAction() { return lastAction; }
    public void setLastAction(String lastAction) { this.lastAction = lastAction; }
    
    public int getLastActionAmount() { return lastActionAmount; }
    public void setLastActionAmount(int lastActionAmount) { this.lastActionAmount = lastActionAmount; }
    
    /**
     * 是否还在局中（未弃牌）
     */
    public boolean isInHand() {
        return status == PlayerStatus.ACTIVE || status == PlayerStatus.ALL_IN;
    }
    
    /**
     * 玩家状态枚举
     */
    public enum PlayerStatus {
        ACTIVE,     // 在局中
        FOLDED,     // 已弃牌
        ALL_IN,     // All-in
        WAITING     // 等待行动
    }
}

